package com.hpeu_01.CarApp;

import lombok.Data;

@Data
//客车类
public class Bus extends Automobile {
    int seatsNumber;//座位数

    public Bus(String carNumber, String brand, int dailyRent, int seatsNumber) {
        super(carNumber, brand, dailyRent);
        this.seatsNumber = seatsNumber;
    }

    //计算租金
    @Override
    public float rent(int days) {
        float price = this.getDailyRent() * days;
        if(days>=3 && days<7){
            price*=0.9f;
        }else if(days>=7 && days<30){
            price*=0.8f;
        }else if(days>=30 && days<150){
            price*=0.7f;
        }else if(days>=150){
            price*=0.6f;
        }
        return price;
    }
}
